package cn.shujuhai.qtadmin.platform.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import cn.shujuhai.qtadmin.platform.domain.Role;

/**
 * @author dch
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 获取yo用户角色列表
     *
     * @param userId
     *            ：用户id
     * @return 用户角色列表
     */
    @Select("select sr.name from user_role ur inner join sys_role sr on sr.id = ur.role_id and sr.deleted=0 where ur.user_id = #{userId} and ur.deleted=0")
    List<String> findRoleByUsrName(@Param("userId") Long userId);

}
